package com.letoy.study.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program:letoy-study-java
 * @author: WeiHaoL
 * @Time: 2021/2/4  下午3:36
 */

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Value("${localPath}")
    String localPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/video/**").addResourceLocations("file:/workspace/letoy-study/static/video/");
        registry.addResourceHandler("/video/**").addResourceLocations("file:/Users/weihaolee/GengdanSpring/");
        registry.addResourceHandler("/video/**").addResourceLocations(localPath);
    }
}
